package booksys.Shome;


import booksys.Mhome.Manager;
import booksys.Shome.Student;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.Map;

@Mapper
public interface HomeDao {

    @Select("select * from student where st_id = #{id}")
    Student findStudentById(String userId);

    @Update("update student set st_avatar = #{avatar} where st_id = #{uid}")
    void updateAvatar(@Param("uid") String userId, @Param("avatar") String filename);

    @Update("update student set st_name=#{userName},st_sex=#{sex},st_phone=#{phone},st_mail=#{email} where st_id = #{userId}")
    void updateStudent(Map<String, Object> dto);

    @Update("update student set st_pwd=#{new} where st_id = #{id}")
    void updatePassword(Map<String, Object> dto);
    @Select("select * from student where st_id = #{id} and st_pwd=#{old}")
    Student confirmPassword(Map<String, Object> dto);
}
